package org.kosta.android.samples.part1;

import org.kosta.android.samples.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class IntentMyActivity extends Activity {
	
	private EditText mEditText;
	private String editTextValue;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_activity);
        
        mEditText = (EditText)findViewById(R.id.textValue);
        
        Button btn = (Button)findViewById(R.id.button);
        btn.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				editTextValue = mEditText.getText().toString();
				Intent intent = new Intent(IntentMyActivity.this, OtherActivity.class);
				intent.putExtra("name", editTextValue);
				startActivity(intent);
			}
		});
    }

}
